<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="*|/"><xsl:apply-templates/></xsl:template>

<xsl:template match="text()|@*"><xsl:value-of select="."/></xsl:template>

<xsl:template match='nbsp' name='nbsp'>
<xsl:text disable-output-escaping='yes'>&amp;nbsp;</xsl:text>
</xsl:template>

<xsl:template name="lf2br">
 <xsl:param name="text"/>
 <xsl:choose>
   <xsl:when test="contains($text,'&#10;')">
     <xsl:value-of select="substring-before($text,'&#10;')"/>
     <br/>
     <xsl:call-template name="lf2br">
       <xsl:with-param name="text">
         <xsl:value-of select="substring-after($text,'&#10;')"/>
       </xsl:with-param>
     </xsl:call-template>
   </xsl:when>
   <xsl:otherwise>
     <xsl:value-of select="$text"/>
   </xsl:otherwise>
 </xsl:choose>
</xsl:template>

<xsl:template match="forum">

<table bgcolor="#EEEEEE" class="body" border="0" cellspacing="0" cellpadding="5" >
<xsl:for-each select="message">
<tr>
<td colspan="3" align="center">Stai rispondendo al seguente messaggio nel forum <xsl:value-of select="/forum/@title"/> scritto da
	<xsl:choose>
		<xsl:when test='@ngId'>
			<xsl:value-of select="@ngFrom"/>
		</xsl:when>
		<xsl:otherwise>
			<a style="color:#006699;" href="profileShow.aspx?userGuid={@userid}"><xsl:value-of select="@nick"/></a>
		</xsl:otherwise>
	</xsl:choose>
in data <xsl:value-of select="@time"/>
</td>
</tr>
<tr>
<td colspan="3">
	  <xsl:call-template name="lf2br">
		<xsl:with-param name="text" select="@text"/>
	  </xsl:call-template>
</td>
</tr>
</xsl:for-each>

</table>
</xsl:template>

</xsl:stylesheet>